<?php
/**
 * @package panel
 * @subpackage panel.settings
**/
/**
 * Panel mail send settings
 * @author Dmitry Bakaleinik (code)
 */
abstract class panel__settings__mail {

	static public function isEnabled()  {

		return (panel__settings__environment::getState() == "production");

	}	# Function

	/**
	 * @return Swift_Connection_SMTP
	**/
	static public function getConnection() {

		static $connection;

		if( !isset($connection) ) {

			$connection = new Swift_Connection_SMTP(
				"smtp.gmail.com",
				Swift_Connection_SMTP::PORT_SECURE,
				Swift_Connection_SMTP::ENC_TLS
			);

			$connection->setUsername("ktulhu.deb");
			$connection->setPassword("1q2w3e4r");

		}	# if

		return $connection;

	}	# Function

	static public function getRecipients() {

		static $recipients;

		if( !isset($recipients) ) {

			$recipients = new Swift_RecipientList();
			$recipients->addTo("demonglo@gmail.com");

		}	# if

		return $recipients;

	}	# Function

}	# Class

/* EOF */